/***********************************************************************
 * Module:  QuayHang.cs
 * Author:  Tuan Nguyen
 * Purpose: Definition of the Class QuayHang
 ***********************************************************************/

using System;

public class QuayHang
{
   public string TenPhongBan;
   public string DiaChiPhongBan;
   public string DienThoaiPhong;
   public string TenQuay;
   
   public System.Collections.ArrayList ChiLatVatTaiQuay;
   public System.Collections.ArrayList sanPhamTaiQuay;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetSanPhamTaiQuay()
   {
      if (sanPhamTaiQuay == null)
         sanPhamTaiQuay = new System.Collections.ArrayList();
      return sanPhamTaiQuay;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetSanPhamTaiQuay(System.Collections.ArrayList newSanPhamTaiQuay)
   {
      RemoveAllSanPhamTaiQuay();
      foreach (SanPhamTaiQuay oSanPhamTaiQuay in newSanPhamTaiQuay)
         AddSanPhamTaiQuay(oSanPhamTaiQuay);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddSanPhamTaiQuay(SanPhamTaiQuay newSanPhamTaiQuay)
   {
      if (newSanPhamTaiQuay == null)
         return;
      if (this.sanPhamTaiQuay == null)
         this.sanPhamTaiQuay = new System.Collections.ArrayList();
      if (!this.sanPhamTaiQuay.Contains(newSanPhamTaiQuay))
      {
         this.sanPhamTaiQuay.Add(newSanPhamTaiQuay);
         newSanPhamTaiQuay.SetQuayHang(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveSanPhamTaiQuay(SanPhamTaiQuay oldSanPhamTaiQuay)
   {
      if (oldSanPhamTaiQuay == null)
         return;
      if (this.sanPhamTaiQuay != null)
         if (this.sanPhamTaiQuay.Contains(oldSanPhamTaiQuay))
         {
            this.sanPhamTaiQuay.Remove(oldSanPhamTaiQuay);
            oldSanPhamTaiQuay.SetQuayHang((QuayHang)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllSanPhamTaiQuay()
   {
      if (sanPhamTaiQuay != null)
      {
         System.Collections.ArrayList tmpSanPhamTaiQuay = new System.Collections.ArrayList();
         foreach (SanPhamTaiQuay oldSanPhamTaiQuay in sanPhamTaiQuay)
            tmpSanPhamTaiQuay.Add(oldSanPhamTaiQuay);
         sanPhamTaiQuay.Clear();
         foreach (SanPhamTaiQuay oldSanPhamTaiQuay in tmpSanPhamTaiQuay)
            oldSanPhamTaiQuay.SetQuayHang((QuayHang)null);
         tmpSanPhamTaiQuay.Clear();
      }
   }
   public System.Collections.ArrayList chiTietHoaDon;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetChiTietHoaDon()
   {
      if (chiTietHoaDon == null)
         chiTietHoaDon = new System.Collections.ArrayList();
      return chiTietHoaDon;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetChiTietHoaDon(System.Collections.ArrayList newChiTietHoaDon)
   {
      RemoveAllChiTietHoaDon();
      foreach (ChiTietHoaDon oChiTietHoaDon in newChiTietHoaDon)
         AddChiTietHoaDon(oChiTietHoaDon);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddChiTietHoaDon(ChiTietHoaDon newChiTietHoaDon)
   {
      if (newChiTietHoaDon == null)
         return;
      if (this.chiTietHoaDon == null)
         this.chiTietHoaDon = new System.Collections.ArrayList();
      if (!this.chiTietHoaDon.Contains(newChiTietHoaDon))
      {
         this.chiTietHoaDon.Add(newChiTietHoaDon);
         newChiTietHoaDon.SetQuayHang(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveChiTietHoaDon(ChiTietHoaDon oldChiTietHoaDon)
   {
      if (oldChiTietHoaDon == null)
         return;
      if (this.chiTietHoaDon != null)
         if (this.chiTietHoaDon.Contains(oldChiTietHoaDon))
         {
            this.chiTietHoaDon.Remove(oldChiTietHoaDon);
            oldChiTietHoaDon.SetQuayHang((QuayHang)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllChiTietHoaDon()
   {
      if (chiTietHoaDon != null)
      {
         System.Collections.ArrayList tmpChiTietHoaDon = new System.Collections.ArrayList();
         foreach (ChiTietHoaDon oldChiTietHoaDon in chiTietHoaDon)
            tmpChiTietHoaDon.Add(oldChiTietHoaDon);
         chiTietHoaDon.Clear();
         foreach (ChiTietHoaDon oldChiTietHoaDon in tmpChiTietHoaDon)
            oldChiTietHoaDon.SetQuayHang((QuayHang)null);
         tmpChiTietHoaDon.Clear();
      }
   }
   public System.Collections.ArrayList chiTietDonDatHang;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetChiTietDonDatHang()
   {
      if (chiTietDonDatHang == null)
         chiTietDonDatHang = new System.Collections.ArrayList();
      return chiTietDonDatHang;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetChiTietDonDatHang(System.Collections.ArrayList newChiTietDonDatHang)
   {
      RemoveAllChiTietDonDatHang();
      foreach (ChiTietDonDatHang oChiTietDonDatHang in newChiTietDonDatHang)
         AddChiTietDonDatHang(oChiTietDonDatHang);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddChiTietDonDatHang(ChiTietDonDatHang newChiTietDonDatHang)
   {
      if (newChiTietDonDatHang == null)
         return;
      if (this.chiTietDonDatHang == null)
         this.chiTietDonDatHang = new System.Collections.ArrayList();
      if (!this.chiTietDonDatHang.Contains(newChiTietDonDatHang))
      {
         this.chiTietDonDatHang.Add(newChiTietDonDatHang);
         newChiTietDonDatHang.SetQuayHang(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveChiTietDonDatHang(ChiTietDonDatHang oldChiTietDonDatHang)
   {
      if (oldChiTietDonDatHang == null)
         return;
      if (this.chiTietDonDatHang != null)
         if (this.chiTietDonDatHang.Contains(oldChiTietDonDatHang))
         {
            this.chiTietDonDatHang.Remove(oldChiTietDonDatHang);
            oldChiTietDonDatHang.SetQuayHang((QuayHang)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllChiTietDonDatHang()
   {
      if (chiTietDonDatHang != null)
      {
         System.Collections.ArrayList tmpChiTietDonDatHang = new System.Collections.ArrayList();
         foreach (ChiTietDonDatHang oldChiTietDonDatHang in chiTietDonDatHang)
            tmpChiTietDonDatHang.Add(oldChiTietDonDatHang);
         chiTietDonDatHang.Clear();
         foreach (ChiTietDonDatHang oldChiTietDonDatHang in tmpChiTietDonDatHang)
            oldChiTietDonDatHang.SetQuayHang((QuayHang)null);
         tmpChiTietDonDatHang.Clear();
      }
   }
   public PhongBan phongBan;
   
   /// <pdGenerated>default parent getter</pdGenerated>
   public PhongBan GetPhongBan()
   {
      return phongBan;
   }
   
   /// <pdGenerated>default parent setter</pdGenerated>
   /// <param>newPhongBan</param>
   public void SetPhongBan(PhongBan newPhongBan)
   {
      if (this.phongBan != newPhongBan)
      {
         if (this.phongBan != null)
         {
            PhongBan oldPhongBan = this.phongBan;
            this.phongBan = null;
            oldPhongBan.RemoveQuayHang(this);
         }
         if (newPhongBan != null)
         {
            this.phongBan = newPhongBan;
            this.phongBan.AddQuayHang(this);
         }
      }
   }

}